package com.howbuy.test.testenum.senior;

/**
 * 网关枚举接口，定义网关所有内部状态的枚举
 * @author boqi.feng
 *
 */
public interface Gateway {
	
	/**
	 * 上送系统类型
	 * @author boqi.feng
	 *
	 */
	enum SysTypeEnum implements Gateway{
		/**
		 * 00 支付网关
		 */
		GATEWAY("00", "支付网关"),
		/**
		 * 01  支付系统
		 */
		PAYMENT("01", "支付系统");
		
		public String value;
		
		public String desc;
		
		private SysTypeEnum(String value,String desc) {
			this.value = value;
			this.desc=desc;
		}
		
		public static SysTypeEnum getValue(String value) {
			for (SysTypeEnum tempEnum : SysTypeEnum.values()) {
				if (tempEnum.toString().equals(value)) {
					return tempEnum;
				}
			}
			return null;
		}
		
		public  String getValue(){
			return this.value;
		}
		
		public String getDesc(){
			return this.desc;
		}
		
		@Override
		public String toString() {
			return this.getValue();
		}
	}
	
	/**
	 * 任务类型
	 * @author boqi.feng
	 *
	 */
	enum TaskStateEnum implements Gateway{
		/**
		 * 00 对账数据下载
		 */
		CHECK_DOWN("00", "对账数据下载"), 
		/**
		 * 01 清算数据下载
		 */
		SETTLE_DOWN("01", "清算数据下载"), 
		/**
		 * 02 结算文件上传
		 */
		SETTLE_UPDATE("02", "结算文件上传");
		
		public String value;
		
		public String desc;
		
		private TaskStateEnum(String value,String desc) {
			this.value = value;
			this.desc=desc;
		}
		
		/**
		 * 根据银行缩写获得银行编号
		 */
		public static TaskStateEnum getValue(String value) {
			for (TaskStateEnum tempEnum : TaskStateEnum.values()) {
				if (tempEnum.toString().equals(value)) {
					return tempEnum;
				}
			}
			return null;
		}
		
		public  String getValue(){
			return this.value;
		}
		
		public String getDesc(){
			return this.desc;
		}
		
		@Override
		public String toString() {
			return this.getValue();
		}
	}
	
	/**
	 * 启动状态
	 * @author boqi.feng
	 *
	 */
	enum RunStateEnum implements Gateway{
		/**
		 * 00 未启动
		 */
		STARTSTATE_UNUSED("00","未启动"),
		/**
		 * 01 已启动
		 */
		STARTSTATE_USED("01","已启动");
		
		public String value;
		
		public String desc;
		
		private RunStateEnum(String value,String desc) {
			this.value = value;
			this.desc=desc;
		}
		
		/**
		 * 根据银行缩写获得银行编号
		 */
		public static RunStateEnum getValue(String value) {
			for (RunStateEnum tempEnum : RunStateEnum.values()) {
				if (tempEnum.toString().equals(value)) {
					return tempEnum;
				}
			}
			return null;
		}
		
		public  String getValue(){
			return this.value;
		}
		
		public String getDesc(){
			return this.desc;
		}
		
		@Override
		public String toString() {
			return this.getValue();
		}
	}

}
